package com.mz.ozy.mvp.presenter;


import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.mvp.model.QCDetailModel;
import com.mz.ozy.bean.QCDetailBean;
import com.mz.ozy.mvp.view.QCDetailContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class QCDetailPresenter extends BasePresenterImpl<QCDetailContract.View> implements QCDetailContract.Presenter{

    private QCDetailModel mModel;

    public QCDetailPresenter(){
        mModel = new QCDetailModel();
    }




    @Override
    public void getQCDetail(Activity activity, String pageNo) {
        mModel.getQCDetail(activity,pageNo)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<QCDetailBean>(mView,false){
                    @Override
                    public void onSuccesss(QCDetailBean bean) {
                        mView.getQCDetailSuccess(bean);
                    }
                });
    }
}
